#ifndef CELL_H
#define CELL_H

#include "key.h"

namespace RealScan
{

// Represents a cell in `Table`
template <typename T>
struct Cell
{
    // Index of the cell
    Key key;

    // Additional information stored in the cell
    T value;

    // Constructor with key and value
    Cell(const Key& _key, const T& _value) : key(_key), value(_value) {}

    // Copy constructor
    Cell(const Cell& other) : key(other.key), value(other.value) {}

    // Copy assignment operator
    Cell& operator=(const Cell& other)
    {
        if (this != &other) // Self-assignment check
        {
            key = other.key;
            value = other.value;
        }
        return *this;
    }

    // Destructor
    ~Cell() = default;
};

} /* RealScan */

#endif /* CELL_H */